Skip to content

feat: add radosgw-admin multisite read wrappers - #809

Draft
johnramsden wants to merge 4 commits into
canonical:mainfrom
johnramsden:feat/rgw-multisite-read-wrappers
Draft

feat: add radosgw-admin multisite read wrappers#809
johnramsden wants to merge 4 commits into
canonical:mainfrom
johnramsden:feat/rgw-multisite-read-wrappers

Conversation

@johnramsden

Copy link
Copy Markdown
Member

Description

Add plumbing for RGW multisite replication

  • radosgw-admin exec wrapper with a remote-cluster variant and typed
  • JSON-backed wrappers for realm get, zonegroup get, zone get, metadata sync status, per-source data sync status, and the mdlog/datalog head markers.

Failing commands yield zero-value results with a nil error, mirroring the RBD wrapper contract, so the upcoming replication handler can treat an unconfigured gateway as ordinary disabled state.

Fixtures are captured from a live two-site squid deployment, covering master, secondary and unconfigured views.

Nothing calls this code yet; the replication handler arrives in a follow-up.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Mocked unit tests exercise new functions

Contributor checklist

Please check that you have:

  • self-reviewed the code in this PR
  • added code comments, particularly in less straightforward areas
  • checked and added or updated relevant documentation
  • added tests to verify effectiveness of this change

Add the inert read-only plumbing for RGW multisite replication (CE062):
a radosgw-admin exec wrapper with a remote-cluster variant and typed,
JSON-backed wrappers for realm get, zonegroup get, zone get, metadata
sync status, per-source data sync status, and the mdlog/datalog head
markers. Catch-up verdicts are computed deterministically from local
sync markers versus the peer's log heads (readable over RADOS through
an imported remote), using the same per-shard comparison rule the
radosgw-admin sync status text applies internally; that text is not
parsed at all since the command ignores --format json on both squid
and tentacle. Failing commands yield zero-value results with a nil
error, mirroring the RBD wrapper contract, so the upcoming replication
handler can treat an unconfigured gateway as ordinary disabled state.

Fixtures are captured from a live two-site squid deployment, covering
master, secondary and unconfigured views.

Nothing calls this code yet; the replication handler arrives in a
follow-up.

Assisted-by: claude-code:claude-fable-5
Signed-off-by: John Ramsden <john.ramsden@canonical.com>

@sabaini sabaini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for this @johnramsden left a few nits / questions

Comment thread microceph/ceph/test_assets/rgw_zone_get.json
Comment thread microceph/ceph/rgw_multisite.go
Comment thread microceph/ceph/rgw_multisite.go
Comment thread microceph/ceph/rgw_multisite.go
Comment thread microceph/ceph/rgw_multisite.go
@johnramsden
johnramsden marked this pull request as draft August 11, 2026 01:20
Signed-off-by: John Ramsden <john.ramsden@canonical.com>
ComputeRgwMetadataSyncVerdict and ComputeRgwDataSyncVerdict now derive
FullSyncShards as NumShards minus the count confirmed incremental,
matching upstream radosgw-admin's total_behind formula
(shards_behind.size() + (num_shards - num_inc)) instead of only
counting shards explicitly present with a non-incremental state. A
shard missing from the response entirely - not just one explicitly
reported full sync - now blocks CaughtUp, instead of being silently
ignored.

Addresses Peter Sabaini's PR canonical#809 review comment: "the worry is that
if partial/initializing shards could be reported as caught up."

Assisted-by: claude-code:claude-sonnet-5
Signed-off-by: John Ramsden <john.ramsden@canonical.com>
Address Peter Sabaini's PR canonical#809 review comments: "suggest to check
invariants before returning as a safety, later on we do indexing on
keys e.g. eg. NumShards >= 0, keys between 0 and NumShards. if
NumShards==0 i think there must not be markers?"

Signed-off-by: John Ramsden <john.ramsden@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants